package com.cj.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117688935";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCKDrqsdSF43IK0dWFzkNxXJZ2eFO8ACWQSNdZIpyX5QuqUyGuJEFD0O2JfvjXdLii+AcR3oRdG/0Fwvn+GA95bqQmq5VLtNre7D4CJaaJIYHlBJ9nkLO47iLS+uXEHmhYpGs+JKh2Xwzs+i8Bt4gw6pQZn1fnQRTgKdSDbQW/bBKRDco+O33jbjv8YcxojnaZyPU7KFOayNpR/wRKeUsugrEVMww3sq2yhhWnF4HyW87tWNFi9/og8ys3qxpquHW6SggKT9005R6dgW6WwWPVBgiRncwX50+EeUEry/Z0sJINQz5LtLpcjvVj2zmUyG481L7KhokZi//r+MdyyqCGvAgMBAAECggEAdbIO5L1Klt3us+ep97rUjZrs33rbMf3PiVLKZs/QqMqqb8LZIlV9nmkN+a+P/gq/AxVAp/f2fzlXUcWls9uScjQOoNm2M7LFOb0CiKM8jVVpqelOcZ74TlrCNCKlwKRVJh/MNBRqfBodZLoBh+wBHvHXHyilOy/3kbq/EwybTmxK/5iSzrtHrO9XKtekBLeEkYCgx6hmQeNxZH2VHP6mXF9KKr+uKV7OfsOsFpMNFlJvFyyrg5yhR30OjZFN2vkPfhNP3lpBz3kauNs8FMKl7ctforFv9c0jHn0NS3zo5+JMO6UyvOeYXQt99rjx6t5OlSiOGjTB05vyqIN6SK+SiQKBgQC/nYZ+To354ofDowwQ6ATYM7YeYpVKQwXzYOiEBNvSZNWMVYb8loS0TxRi6D8rHjMtO+pWg/GZcZqiWXF3x+8CnsYkTIrbser5D9XomwDVS1xE2HDsr+vofvmmhCCVmmGforgXmg/7Cs1+K85pSIVZbn6LFmosB9L9F623WjdS6wKBgQC4cj1Ed54uyqnACsMky983NnsxMOrFMuysNY3p65tnPhOM60IOiWVz2v0KBrPROGL8CRIzmdYSvSNlOqa4n5PzpG8yvYAw6jR5Hi4sL/UnykPQh4eyf/3OAKUu3uH+oFTAb4lYy1zv74Q29Dl2SyLbR6M3AlVCCf5CSNFEI+ZTTQKBgCBKR3PZgQtvJTnOrCXdM5PLgxEzw7yz9rjAx+4Xc4PNAj+X2huOseZAvUq9oId/m1gwFJlnursE7e4V7I0m4Bws7W8Ihw3muZYnGQENveIzxOTFJKJ+Mt8HJsLs2SDc1z6ziRpRGAhSFbcBYtNTKUWc3S5LJLEu0FteNiQDy/bpAoGBAKRfwrQSuhjPKaporPJM8fd9iRoUkxT8xijObVNrUgoXK0spmavkzFIMdfcKdBPfYW9lEiCEV2BJyJJ9S3k7VZoLD8IzWVu+TNcni1R7xMoaGodrUQZFxEVjE9KKdPL7pav9enR0f7WgSb7DtbXzTfQHirAKVzrMNxiRVlWYfLn9AoGBAIxNXjUWKyW2LPggDaOR+1z6vg9bHl1W1SzJmQ55pmGGbWMIHGmK5lJEuGHhZbTTxIBwszl+UOvnwqRUPmHX0RPqqCFaDnsLChSoBCQg9oJHgpHnEy43GH4gQg8I8NM2Yw/K2ZEmxlgzbUf7xNAwsSGJ7qBaBxKJBWzWY03mhxbi";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArUxyFy1yYigc6/smOOwXevhS4/5+GShlp1oxTjD0BRRxpCQHqkBHS9lpCjXmlIrTjyJNvSAyJk1bqGSd6XF7Y9lKRjxiO2wUEkz33wTqbnPyAZ7VDT9os/pM0O5ODqlc66Q6iZoefwi4p1CeoE2JRDZcODVTV7lLR+cOsdeCCO6giDgn3+crolb41VA5VOgsocbjTFGUBe+zy8CFyOMDCNu04zlEEyYO6caV1/Ct7YI44//cuUeZQEJEcaXYPEta4sDWuWqadEUxsHsoEpJKSgUWPiDCh8kbgNlHY+bXQkBKn/9bLTo22g4XN+IuyrIMeLTjXMFaNGaesn7PQc9F5wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String notify_url = "http://www.baidu.com";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://127.0.0.1:5051/%D0%A1u%D1%A7%CF%B0/pages/course.html/";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

